home *** CD-ROM | disk | FTP | other *** search
/ Chip: Hang es video / CHIP_ZENESZERKESZTO_2005.ISO / audio_3 / visual / robotfunk / setup.exe / {app} / main.dxr / modules_4.ls < prev    next >
Encoding:
Text File  |  2003-11-19  |  2.7 KB  |  117 lines

  1. property spriteNum, curpath, mymem, curdrive, filex, isinroot, diskready
  2.  
  3. on beginSprite me
  4.   mymem = sprite(spriteNum).member
  5.   filex = 0
  6.   filex = new(xtra("FileXtra4"))
  7.   getdrives()
  8.   curpath = EMPTY
  9.   mymem.scrollTop = 0
  10.   sprite(spriteNum).locH = -400
  11.   sprite(spriteNum).locZ = 700
  12.   isinroot = 1
  13. end
  14.  
  15. on getdrives me
  16.   mymem.text = EMPTY
  17.   folders = filex.fx_VolumesToList()
  18.   repeat with i in folders
  19.     mymem.text = mymem.text & i & RETURN
  20.   end repeat
  21.   mymem.scrollTop = 0
  22.   isinroot = 1
  23. end
  24.  
  25. on getfiles me
  26.   mtext = ".." & RETURN
  27.   files = filex.fx_FolderToList(curpath)
  28.   topp = EMPTY
  29.   bott = EMPTY
  30.   if listp(files) then
  31.     repeat with i in files
  32.       if the platform contains "Mac" then
  33.         if i.char[i.chars.count] = ":" then
  34.           topp = topp & i & RETURN
  35.         else
  36.           bott = bott & i & RETURN
  37.         end if
  38.         next repeat
  39.       end if
  40.       if i.char[i.chars.count] = "\" then
  41.         topp = topp & i & RETURN
  42.         next repeat
  43.       end if
  44.       bott = bott & i & RETURN
  45.     end repeat
  46.     mtext = mtext & topp & bott
  47.     mymem.text = mtext
  48.     mymem.scrollTop = 0
  49.   end if
  50.   isinroot = 0
  51. end
  52.  
  53. on mouseWithin me
  54.   if spriteNum = the rollover then
  55.     hilite mymem.line[the mouseLine]
  56.   end if
  57. end
  58.  
  59. on selectfilee filen, frames
  60.   selectfile(filen, frames)
  61. end
  62.  
  63. on mouseUp me
  64.   delim = the itemDelimiter
  65.   if the platform contains "Mac" then
  66.     the itemDelimiter = ":"
  67.   else
  68.     the itemDelimiter = "\"
  69.   end if
  70.   currentLine = member(mymem).line[the mouseLine]
  71.   if currentLine = ".." then
  72.     itemcount = the number of items in curpath
  73.     newpath = EMPTY
  74.     repeat with i = 1 to itemcount - 2
  75.       newpath = newpath & curpath.item[i] & the itemDelimiter
  76.     end repeat
  77.     curpath = newpath
  78.     if curpath.items.count > 1 then
  79.       getfiles()
  80.     else
  81.       curpath = EMPTY
  82.       getdrives()
  83.     end if
  84.   else
  85.     if isinroot then
  86.       curdrive = currentLine.char[1]
  87.       diskready = baDiskInfo(curdrive, "size") > 0
  88.     end if
  89.     if diskready then
  90.       lepath = curpath & currentLine
  91.       if lepath.char[lepath.chars.count] = the itemDelimiter then
  92.         curpath = lepath
  93.         getfiles()
  94.       else
  95.         if baFileExists(lepath) then
  96.           sprite(180).locH = -400
  97.           sprite(181).locH = -400
  98.           sprite(165).visible = 1
  99.           sprite(165).locZ = 999
  100.           tell sprite(165)
  101.             go("aan")
  102.           end tell
  103.           updateStage()
  104.           tell sprite(165)
  105.             sprite(25).import(lepath)
  106.           end tell
  107.           tell sprite(165)
  108.             sprite(3).rect = rect(0, 1, 128, 97)
  109.           end tell
  110.         end if
  111.       end if
  112.     end if
  113.   end if
  114.   member("file_path_head").text = curpath
  115.   the itemDelimiter = delim
  116. end
  117.